2024-05-15

Introduction

  • Data set obtained from (Kaggle.com).

  • A comprehensive collection of property listings, encompassing various attributes such as the number of bedrooms, bathrooms, living area size, lot size, and location details in King County, WA.

  • Aids in identifying trends and patterns in the real estate market, assisting investors, real estate agents, and policymakers in making informed decisions.

  • Also, serves as a foundation for developing recommendation systems for homebuyers, guiding them towards properties that align with their preferences and requirements.

Research Question and Hypothesis

  • Research Question: Does the ratio of bathrooms to bedrooms impact the price of a house?

  • \(H_0\) The mean price of houses with different bathroom to bedroom ratios are the same i.e. \(\mu_1 = \mu_2\)

  • \(H_a\) The mean price of houses with different bathroom to bedroom ratios are not the same i.e. \(\mu_1 \neq \mu_2\).

Exploratory Data Analysis (EDA)

  • Log scaled price variable to ensure linearity among variables.

  • Added variables

    • Bathroom-to-Bedroom Ratio: \(\frac{bathroom}{bedroom}\).
    • Zip Code Region: Split King County into two regions w/ zip codes 980 and 981.
    • Factor Levels: \(\frac{bathroom}{bedroom} < 1\) and \(\frac{bathroom}{bedroom} \geq 1\).
    • Blocks: Split the distribution of the total square feet variable into 4 blocks corresponding to quantile.
  • Outliers for bathroom, bedroom, and total square feet were normalized to fall within 3 standard deviations.

  • A Randomized Complete Block Design was performed on the data to test the difference in means between bath:bed.

EDA Continued

King County Map of Houses by Log Price

Ridgeline Plot

Shiny App

Box Plot

Scatter Plot

ANOVA Test

ANOVA Summary
Df Sum Sq Mean Sq F value Pr(>F)
factor levels 1 42.62638 42.6263777 269.2438 0
blocks 3 2166.52145 722.1738157 4561.5134 0
Residuals 21295 3371.40115 0.1583189 NA NA
  • \(\alpha\) = 0.05
  • P-Value < 0.0001
  • \(F^*\) = 269.2438
  • F(0.95, 1, 3) = 10.1
  • \(F^*\) > F and P-Value < \(\alpha\)
  • Conclude \(H_a\)

Bootstrap

Conclusion

  • There is significant difference between house prices concerning the number of bathrooms each house has.

  • Adding an extra half-bathroom could potentially increase the value of your home.

  • Construction contractors can net a greater profit by building homes with an additional bathroom.

  • Real Estate agents can increase their commissions by selling homes with an additional bathroom.

References